//
//  YQIncubatorProjectVC.m
//  NewRetail
//
//  Created by yuqin on 2019/6/24.
//  Copyright © 2019 yuqin. All rights reserved.
//

#import "YQIncubatorProjectVC.h"
#import "YQProjectHeadView.h"
#import "YQProjectMiddleView.h"

@interface YQIncubatorProjectVC ()

@property (nonatomic, strong) YQProjectHeadView *projectView;
@property (nonatomic, strong) YQProjectMiddleView *middleView;
@property (nonatomic, strong) UIButton *commitBtn;
@property (nonatomic, strong) UILabel *describeLab;

@end

@implementation YQIncubatorProjectVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.txtTitle.text = @"孵化项目";
    self.view.backgroundColor = UIColorFromRGB(0xeeeeee);
    [self setupProjectView];
}

- (void)setupProjectView {
    [self.view addSubview:self.projectView];
    [self.view addSubview:self.middleView];
    [self.view addSubview:self.commitBtn];
    [self.view addSubview:self.describeLab];
    
    
    
    [self.projectView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(NavigationStatusBarHeight);
        make.size.mas_equalTo(CGSizeMake(ScreenWidth, FIT(120)));
    }];
    
    [self.middleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.equalTo(self.projectView.mas_bottom).mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(ScreenWidth, FIT(185)));
    }];
    
    [self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kMargin_left);
        make.top.equalTo(self.middleView.mas_bottom).mas_equalTo(FIT(40));
        make.size.mas_equalTo(CGSizeMake(ScreenWidth-FIT(32), kButtonHeight));
    }];
    
    [self.describeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.equalTo(self.commitBtn.mas_bottom).mas_equalTo(FIT(20));
        make.size.mas_equalTo(CGSizeMake(ScreenWidth, FIT(20)));
    }];
}

- (YQProjectHeadView *)projectView {
    if (!_projectView) {
        _projectView = [[YQProjectHeadView alloc] init];
    }
    return _projectView;
}

- (YQProjectMiddleView *)middleView {
    if (!_middleView) {
        _middleView = [[YQProjectMiddleView alloc] init];
        @weakify(self);
        _middleView.SelectWalletAddressBlock = ^{
            @strongify(self);
            //点击跳转到钱包页面
        };
    }
    return _middleView;
}

- (UIButton *)commitBtn {
    if (!_commitBtn) {
        _commitBtn = [YQViewFactory buttonWithTitle:@"确认孵化" titleColor:WhiteColor fontSize:kNormalButtonFont userBold:YES target:self sel:@selector(commitAction)];
        _commitBtn.backgroundColor = MainBlueColor;
        _commitBtn.layer.cornerRadius = FIT(20)/2.0;
    }
    return _commitBtn;
}

- (UILabel *)describeLab {
    if (!_describeLab) {
        _describeLab = [YQViewFactory labelWithTextColor:[UIColor lightGrayColor] textAlignment:NSTextAlignmentCenter fontSize:kTheTitleFont userBold:NO];
        _describeLab.text = @"孵化到期前无法转出，到期后自动换成孵化资产";
    }
    return _describeLab;
}


#pragma mark - 确定
- (void)commitAction {
    
}

@end
